import java.util.Scanner;
public class BC19 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        if(n<=9999 && n>=1000){
            int a4 = n/1000;
            int a3 = (n-a4*1000)/100;
            int a2 = (n-a4*1000-a3*100)/10;
            int a1 = (n-a4*1000-a3*100-a2*10);
            System.out.print(a1);
            System.out.print(a2);
            System.out.print(a3);
            System.out.print(a4);
        }
    }
}